<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="admin/public/layout">

<head>
    <title>一键登录设置</title>
</head>
<div  layout:fragment="content">
    <section class="content-header">
        <h1>一键登录设置</h1>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="callout callout-warning" th:if="${error}">
                    <p  th:text="${error.message}"></p>
                </div>
                <div class="box box-default">
                    <form th:object="${settingOauth}" role="form" name="addForm" id="register_form" method="POST" th:action="@{/admin/setting/oauth}">
                        <input type="hidden" name="id" th:value="${GlobalSetting.oauth.id}"/>
                        <div class="box-body">
                            <div class="form-group">
                                <label>开启第三方平台账号登录</label>
                                <span class="text-muted">(关闭后则不能使用QQ、微博等第三方平台账号登录系统)</span>
                                <div class="radio">
                                    <label><input type="radio" name="open" value="true" th:checked="${#request.getAttribute('settingOauth').open}" > 开启 </label>
                                    <label class="ml-20"><input type="radio" name="open"  value="false" th:checked="!${#request.getAttribute('settingOauth').open}" > 关闭 </label>
                                </div>
                            </div>
                            <hr />
                            <div class="form-group">
                                <label>QQ互联平台 APP ID</label>
                                <input type="text" class="form-control" name="qqKey" placeholder="APP ID" th:value="${settingOauth.qqKey}"  />
                            </div>
                            <div class="form-group">
                                <label>QQ互联平台 APP key</label>
                                <input type="text" class="form-control" name="qqSecret" placeholder="APP KEY" th:value="${settingOauth.qqSecret}"  />
                            </div>
                            <div class="form-group">
                                <label>QQ互联平台回调地址</label>
                                <span class="text-muted">(此回调地址为程序内置的，请将此地址设置到你申请的QQ互联应用中)</span>
                                <input type="text" class="form-control" name="qqRedirect" placeholder="回调地址" th:value="${GlobalSetting.website.url}+${settingOauth.qqRedirect}" disabled />
                            </div>
                            <hr />
                            <div class="form-group">
                                <label>微博开放平台 APP ID</label>
                                <input type="text" class="form-control" name="weiboKey" placeholder="APP ID" th:value="${settingOauth.weiboKey}" />
                            </div>
                            <div class="form-group">
                                <label>微博开放平台 APP key</label>
                                <input type="text" class="form-control" name="weiboSecret" placeholder="APP KEY" th:value="${settingOauth.weiboSecret}"  />
                            </div>
                            <div class="form-group">
                                <label>微博开放平台回调地址</label>
                                <span class="text-muted">(此回调地址为程序内置的，请将此地址设置到你申请的微博开放平台应用中)</span>
                                <input type="text" class="form-control" name="weiboRedirect" placeholder="回调地址" th:value="${GlobalSetting.website.url}+${settingOauth.weiboRedirect}" disabled />
                            </div>

                        </div>
                        <div class="box-footer">
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>